#include<malloc.h>
#include"session.h"
#include<unistd.h>


Session* create_session(){
    Session* this=(Session*)calloc(1,sizeof(Session));
    this->user_sock_addr=(struct sockaddr_in*)calloc(1,sizeof(struct sockaddr_in));
    this->user=NULL;
    return this;
}

extern Session* close_session(Session *this){
    close(this->sockfd);
    close(this->notice_sockfd);
    return this;
}

Session* destory_session(Session *this){
    if(this==NULL)return NULL;
    free(this->user_sock_addr);
    free(this);
    return NULL;
}
